﻿' Computer Information (clsWMI)
'
' === Information/Examples ===
' WMI .Net Overview: http://msdn.microsoft.com/en-us/library/ms257340(VS.80).aspx
' Object Query: http://msdn.microsoft.com/en-us/library/3x6at5a0.aspx


' Imports
Imports System
Imports System.Management
'
Public Class clsWMI
    ' Example:
    '    Public Overloads Shared Function ProcessorId() As String
    '    Dim StringProcessorId As String = String.Empty
    '
    '    Dim Query As New SelectQuery("Win32_processor")
    '
    '    Dim Searcher As New ManagementObjectSearcher(Query)
    '
    '    Dim WinInfo As ManagementObject
    '
    '        For Each WinInfo In Searcher.Get()
    '            StringProcessorId = WinInfo("Name").ToString
    '        Next
    '        Return StringProcessorId
    '
    '
    '    End Function
    '
    ' Win32_Processor - Name
    '
    ' TODO: Find a better way of calling multiple items.....
    Public Overloads Shared Function ProcessorId() As String
        Dim StringProcessorId As String = String.Empty

        Dim Query As New SelectQuery("Win32_processor")

        Dim Searcher As New ManagementObjectSearcher(Query)

        Dim WinInfo As ManagementObject

        For Each WinInfo In Searcher.Get()
            StringProcessorId = CStr(WinInfo("Name"))
        Next
        Return StringProcessorId


    End Function

End Class
